package halberd.io;

import java.awt.image.BufferedImage;
import java.awt.image.RenderedImage;
import java.io.File;
import java.io.IOException;

import javax.imageio.ImageIO;

public class Imagewriter {
	public static int write(String filename,BufferedImage image) {
		try {
			ImageIO.write((RenderedImage)image, "jpg", new File(filename));
			return 0;
		} catch (IOException e) {
			e.printStackTrace();
			return -1;
		}
	}
}
